`:top
In `F33f`_`[programming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Computer_programming]`_`f and `F33f`_`[software design`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Software_design]`_`f, a `!binding`! is an `F33f`_`[application programming interface`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Application_programming_interface]`_`f (API) that provides `F33f`_`[glue code`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Glue_code]`_`f specifically made to allow a `F33f`_`[programming language`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Programming_language]`_`f to use a foreign `F33f`_`[library`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Library_(computer_science)]`_`f or `F33f`_`[operating system`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Operating_system]`_`f service (one that is not native to that language).
>>Contents
• `F0af`_`[Characteristics`#characteristics]`_`f
• `F0af`_`[Runtime environment`#runtime-environment]`_`f
• `F0af`_`[Object models`#object-models]`_`f
• `F0af`_`[Virtual machines`#virtual-machines]`_`f
• `F0af`_`[Porting`#porting]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[External links`#external-links]`_`f
-─
>>Characteristics
Binding generally refers to a mapping of one thing to another. In the context of `F33f`_`[software libraries`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Library_(computing)]`_`f, bindings are `F33f`_`[wrapper libraries`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wrapper_library]`_`f that bridge two `F33f`_`[programming languages`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Programming_language]`_`f, so that a `F33f`_`[library`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Library_(computing)]`_`f written for one language can be used in another language.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f] Many software libraries are written in `F33f`_`[system programming languages`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=System_programming_language]`_`f such as `F33f`_`[C`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=C_(programming_language)]`_`f or `F33f`_`[C++`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=C++]`_`f. To use such libraries from another language, usually of `F33f`_`[higher-level`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=High-level_programming_language]`_`f, such as `F33f`_`[Java`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Java_(programming_language)]`_`f, `F33f`_`[Common Lisp`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Common_Lisp]`_`f, `F33f`_`[Scheme`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Scheme_(programming_language)]`_`f, `F33f`_`[Python`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Python_(programming_language)]`_`f, or `F33f`_`[Lua`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Lua_(programming_language)]`_`f, a binding to the library must be created in that language, possibly requiring `F33f`_`[recompiling`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Compiler]`_`f the language's code, depending on the amount of modification needed.`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f] However, most languages offer a `F33f`_`[foreign function interface`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Foreign_function_interface]`_`f, such as Python's and `F33f`_`[OCaml`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OCaml]`_`f's `B100`F9d9ctypes`f`b, and `F33f`_`[Embeddable Common Lisp`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Embeddable_Common_Lisp]`_`f's `B100`F9d9cffi`f`b and `B100`F9d9uffi`f`b.`:cite-ref-3[`F5bf`_`[3`#cite-note-3]`_`f]`:cite-ref-4[`F5bf`_`[4`#cite-note-4]`_`f]`:cite-ref-5[`F5bf`_`[5`#cite-note-5]`_`f]
For example, `F33f`_`[Python`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Python_(programming_language)]`_`f bindings are used when an extant C library, written for some purpose, is to be used from Python. Another example is `B100`F9d9libsvn`f`b which is written in C to provide an API to access the `F33f`_`[Subversion`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Apache_Subversion]`_`f `F33f`_`[software repository`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Software_repository]`_`f. To access Subversion from within Java code, `B100`F9d9libsvnjavahl`f`b can be used, which depends on `B100`F9d9libsvn`f`b being installed and acts as a bridge between the language Java and `B100`F9d9libsvn`f`b, thus providing an API that invokes functions from `B100`F9d9libsvn`f`b to do the work.`:cite-ref-6[`F5bf`_`[6`#cite-note-6]`_`f]
Major motives to create library bindings include `F33f`_`[software reuse`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Software_reuse]`_`f, to reduce reimplementing a library in several languages, and the difficulty of implementing some `F33f`_`[algorithms`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Algorithm]`_`f efficiently in some high-level languages.
>>Runtime environment
>>>Object models
• `F33f`_`[Common Object Request Broker Architecture`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Common_Object_Request_Broker_Architecture]`_`f (CORBA) – `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f-language model
• `F33f`_`[Component Object Model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Component_Object_Model]`_`f (COM) – `F33f`_`[Microsoft Windows`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Windows]`_`f only cross-language model
• `F33f`_`[Distributed Component Object Model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Distributed_Component_Object_Model]`_`f (DCOM) – extension enabling COM to work over networks
• Cross Platform Component Object Model (`F33f`_`[XPCOM`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=XPCOM]`_`f) – Mozilla applications `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f model
• `F33f`_`[Common Language Infrastructure`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Common_Language_Infrastructure]`_`f – `F33f`_`[.NET Framework`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=.NET_Framework]`_`f `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f-language model
• `F33f`_`[Freedesktop.org`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Freedesktop.org]`_`f `F33f`_`[D-Bus`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=D-Bus]`_`f – open `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f-language model
>>>Virtual machines
• `F33f`_`[Comparison of application virtual machines`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Comparison_of_application_virtual_machines]`_`f
>>Porting
• `F33f`_`[Portable object`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Portable_object_(computing)]`_`f – `F33f`_`[cross-platform`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cross-platform]`_`f-language object model definition
>>See also
• `F33f`_`[Application programming interface`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Application_programming_interface]`_`f (API)
• `F33f`_`[Application binary interface`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Application_binary_interface]`_`f (ABI)
• `F33f`_`[Calling convention`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Calling_convention]`_`f
• `F33f`_`[Embedded SQL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Embedded_SQL]`_`f
• `F33f`_`[Name mangling`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Name_mangling]`_`f
• Simplified Wrapper and Interface Generator (`F33f`_`[SWIG`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=SWIG]`_`f) – interface binding generator from many languages to many languages, open-source
• `F33f`_`[Wrapper function`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wrapper_function]`_`f
>>References
`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f "Appendix A. Creating a language binding for cairo". Cairographics.org. Retrieved 2014-04-02.
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f "Standards, APIs, Interfaces and Bindings". Acm.org. Archived from the original on 2015-01-16. Retrieved 2014-04-02.
`:cite-note-3`!3.`! `F0af`_`[↑`#cite-ref-3]`_`f "ctypes – A foreign function library for Python". `*Python v3.8.3 documentation`*. Docs.python.org. Retrieved 2020-06-04.
`:cite-note-4`!4.`! `F0af`_`[↑`#cite-ref-4]`_`f `:citerefhickeymadhavapeddyminsky2013`aHickey, Jason; Madhavapeddy, Anil; Minsky, Yaron (2013). "Real Worl OCaml, Chapter 19. Foreign Function Interface". `*realworldocaml.org`*. Archived from the original on 2015-07-18. Retrieved 2015-07-19.
`:cite-note-5`!5.`! `F0af`_`[↑`#cite-ref-5]`_`f "Introduction – CFFI User Manual". Common-lisp.net. Retrieved 2014-04-02.
`:cite-note-6`!6.`! `F0af`_`[↑`#cite-ref-6]`_`f "Subversion JavaHL FAQ". Subclipse.tigris.org. 2013-06-18. Archived from the original on 2014-12-27. Retrieved 2014-04-02.
>>External links
• JTC1/SC22/WG11 - Binding Techniques, an ISO standard for language bindings
• What is a language binding?
`c`F0af`_`[↑ Back to top`#top]`_`f`a